package com.zzk.www;

import com.zzk.www.nettyServer.server.ChatServer;
//import com.zzk.www.service.impl.MessageHelperServiceImpl;
import com.zzk.www.service.MessageHelperService;
import com.zzk.www.service.impl.MessageHelperServiceImpl;
import com.zzk.www.tool.common.BeanHolder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.context.support.FileSystemXmlApplicationContext;
import org.springframework.context.support.GenericXmlApplicationContext;
import org.springframework.stereotype.Component;

/**
 * Created by zzk on 2017/12/18.
 */


public class Main {


    public static void main(String[] args) throws InterruptedException {

        String[] location = new String[]{"classpath:config/spring/applicationContext.xml"};
        BeanHolder.context = new ClassPathXmlApplicationContext(location);

        //启动netty服务器
        new Thread(() -> BeanHolder.get(ChatServer.class).start()).start();

        //启动后台线程
        new Thread(() -> BeanHolder.get(MessageHelperService.class).backgroudTaskProcess()).start();

    }


}
